﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Multithreading2
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Console.WriteLine("Enter a number: ");
            var parameter = double.Parse(System.Console.ReadLine());

            Task task = Task.Factory.StartNew(Square, parameter);
            task.Wait();
            Console.WriteLine("Der fik du den!");
        }

        static void Square(Object n)
        {
            var parameter = (double)n;
            var result = Math.Sqrt(parameter);

            System.Console.WriteLine("Squareroot is: " + result);
        }
    }
}
